/**
 * @author Gavin Koh
 * created 18 Aug 2011
 * This script converts all the child terms for the periplasmic GO IDs to a global JavaScript object.
 */

//GO JSON downloaded 12 Aug 2011

(function() {
	/*
	isOuterMembrane = {};
	var goRegex = /GO:\d{7}/g; //GO id's all start with 'GO:' followed by 7 digits.

	//Outer membrane GO:0009279
	var locOuterMembraneJsonString = '{"id":"GO:0009279","name":"cell outer membrane","children":[{"id":"GO:0031230","name":"intrinsic to cell outer membrane","children":[{"id":"GO:0031243","name":"intrinsic to external side of cell outer membrane"},{"id":"GO:0031246","name":"intrinsic to internal side of cell outer membrane"},{"id":"GO:0045203","name":"integral to cell outer membrane"}]},{"id":"GO:0031244","name":"extrinsic to cell outer membrane","children":[{"id":"GO:0031245","name":"extrinsic to internal side of cell outer membrane"},{"id":"GO:0031242","name":"extrinsic to external side of cell outer membrane"}]},{"id":"GO:0031241","name":"internal side of cell outer membrane"},{"id":"GO:0031240","name":"external side of cell outer membrane"}]}';
	var locOuterMembraneGoArray = locOuterMembraneJsonString.match(goRegex);
	for (i=0; i < locOuterMembraneGoArray.length; i+=1) {
		isOuterMembrane[ locOuterMembraneGoArray[i] ] = true;
		//Create each GO ID as a property of the isPlasmaMembrane object.
		//We only need to test for existence.
		//There should be no repeat GO IDs, because JavaScript will simply reassign true
		//to any properties that are already there.
	};
	isOuterMembraneString = JSON.stringify(isOuterMembrane);
	*/
	//creates a global object so we can save space by hard-coding a smaller JavaScript object
	
	isOuterMembrane = {
		"GO:0005886":true,
		"GO:0009279":true,
		"GO:0009279":true,
		"GO:0016020":true,
		"GO:0019867":true};
})();
